package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by dzw on 2017/12/8.
 * 物品申请
 */
@Entity
@Table(name="ec_goodsApply")
public class GoodsApply extends BaseFlowEntity {
    private static final long serialVersionUID = -2507966919056282337L;

    /**
     * 物品用途
     */
    private String purpose;
    /**
     * 合计金额
     */
    private BigDecimal numMoney;
    /**
     * 领用时间
     */
    private Date useDate;
    /**
     * 领用情况
     */
    private String useCondition;
    /**
     * 详情
     */
    private List<GoodsApplyDetail> goodsApplyDetailList;
    /**
     * 是否已领用 0未领用 1已领用
     */
    private int isUsed;

    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }

    public BigDecimal getNumMoney() {
        return numMoney;
    }

    public void setNumMoney(BigDecimal numMoney) {
        this.numMoney = numMoney;
    }

    public Date getUseDate() {
        return useDate;
    }

    public void setUseDate(Date useDate) {
        this.useDate = useDate;
    }

    public String getUseCondition() {
        return useCondition;
    }

    public void setUseCondition(String useCondition) {
        this.useCondition = useCondition;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_goodsApplyDetail_detail", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="detailId"))
    public List<GoodsApplyDetail> getGoodsApplyDetailList() {
        return goodsApplyDetailList;
    }

    public void setGoodsApplyDetailList(List<GoodsApplyDetail> goodsApplyDetailList) {
        this.goodsApplyDetailList = goodsApplyDetailList;
    }

    public int getIsUsed() {
        return isUsed;
    }

    public void setIsUsed(int isUsed) {
        this.isUsed = isUsed;
    }
}
